Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse quoted text in HTML message #6770

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sazanof
Copy link
Collaborator

@sazanof sazanof commented Jun 21, 2022

Hello everyone!

I will be glad if there is time to discuss my PR and if it will be some useful.

Based on #3640

In fact, I have encountered several (many =)) problems. It would be great if you could tell me something.

A little preface: perhaps this is not the most successful implementation, but I have not found another way yet.

Problems:

  • "OC not found". I need to connect the translation in new Vue() instance and upload avatars functions. And when importing l10n or fetchAvatarUrlMemoized, they just don't work. Tell me how to connect them correctly?
  • CSS syles & variables. Variables and styles are not loaded into the iframe. And importing from core/css gives an error, Tell me how I can include these styles correctly.
  • Different clients always send quotes in different ways. I would like to beautifully get the mail, name, date from the line. But this is practically impossible.

I would like to hear opinions about the implementation, because although it is not urgent, it is a very pleasant improvement. I will be grateful for any help and glad for any advice!

Thanks!

PS: I mainly tested sending between accounts via NC. I tested a little through other email clients. It seems to be (underlined) working. But this is not accurate =)

Well, where to without screenshots:

image
image

Signed-off-by: Mikhail Sazanov m@sazanof.ru

Signed-off-by: Mikhail Sazanov <m@sazanof.ru>
@ChristophWurst
Copy link
Member

Different clients always send quotes in different ways. I would like to beautifully get the mail, name, date from the line. But this is practically impossible.

I think that will always be a bit of catch-up. I suggest we abstract the parsing/detection a bit and put it into a testable function. That function can be unit tested against a few common formattings of popular email clients.

</script>

<style lang="scss" scoped>
.quote {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import HtmlBlockQuoteItem from './HtmlBlockQuoteItem'
import CommentQuote from 'vue-material-design-icons/CommentQuote'

const REGEXP_EMAIL = /([!#-'*+/-9=?A-Z^-~-]+(\.[!#-'*+/-9=?A-Z^-~-]+)*|(\[\]!#-[^-~ \t]|(\\[\t -~]))+")@([!#-'*+/-9=?A-Z^-~-]+(\.[!#-'*+/-9=?A-Z^-~-]+)*|\[[\t -Z^-~]*])/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the part I'd like to see abstracted and tested 😆

@ChristophWurst
Copy link
Member

friendly ping @sazanof

@sazanof
Copy link
Collaborator Author

sazanof commented Sep 29, 2023

4 packets received, 0 packets lost.
Is this PR actual? What do you think?

upd (oh, I see =))

@sazanof
Copy link
Collaborator Author

sazanof commented Oct 12, 2023

Well, there will be something to do =)

@ChristophWurst ChristophWurst mentioned this pull request Nov 29, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants